<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Guest Main</title>
<link rel="stylesheet" href="g_css/gmain.css" type="text/css" />
<script src="js/gmain.js" ></script>
<script src="http://code.jquery.com/jquery-1.7.2.min.js"></script>
</head>
<body>
	<div id="guest_main">
		<div id="guest_mainheader">
			<span id="guest_master">${ master.mName }</span>&nbsp;&nbsp;&nbsp;님의 방명록입니다.
		</div>
		<table id="guest_maintable">
			<c:forEach var="n" items="${list }">
				<tr>
					<td class="guest_mainlist">No</td>
					<td class="guest_mainlist">Writer</td>	
					<td class="guest_mainlist">Date</td>
					<td rowspan="2" class="guest_click"><a href="guestDelete.do?gNo=${n.gNo}">remove</a></td>
				</tr>
				<tr>
					<td class="guest_maininput">${n.gNo }</td>
					<td class="guest_maininput">${n.gWriter }</td>	
					<td class="guest_maininput">${n.gDate }</td>

				</tr>
				<tr>
					<td colspan="4" id="guest_content">
						${n.gContent }
					</td>
				</tr>
				<tr>
					<td id="reply_click">
						<a href="#">reply</a>
					</td>
					<td colspan="3">
						<div id="reply_show">
						<textarea rows="1" cols="60" class="guest_reply" onclick="if(this.value=='댓글을 입력하세요'){this.value=''}">댓글을 입력하세요</textarea>
						<input type="submit" value="ok" class="guest_click" id="guest_ok" />
						</div>
					</td>
				</tr>
				<tr>
					<td colspan="4" id="guest_endtable">

					</td>
				</tr>
			</c:forEach>
		</table>		
		<div id="guest_paging">
			<p>&lt;
				<c:forEach var="i" begin="1" end="${ count }">
					<a href="guest_main.do?pg=${ i }">&nbsp;${ i }&nbsp;</a>
				</c:forEach>
				&gt;
			</p>
		</div>
		<center>
			<div id="guest_footer">
				<form action="guest_main.do" method="post">
					<input type="hidden" name="pg" value="1" />
					<select name="field" class="guest_textarea" >
						<option value="gs_writer">작성자</option>
						<option value="gs_content">내용</option>
					</select>
					<input type="text" name="query" class="guest_textarea" />
					<input type="submit" value="search" class="guest_click" id="guest_search" />
				</form>			
			</div>
		</center>
 	</div>
</body>
</html>